From 59b2f965d41667a8407ad1a4f8b61aa20a1d2d47 Mon Sep 17 00:00:00 2001 From: "sos22@douglas.cl.cam.ac.uk" Date: Thu, 7 Jul 2005 09:27:25 +0000 Subject: [PATCH] Quick hack to make sure that pirqs and interdomain event channels are all bound to vcpu0, rather vcpu0 99% of the time and an entirely random otherwise. This make sure things work nicely when you start taking vcpus offline, since vcpu0 can't go offline; the correct solution is to allow domains to change evtchn<->vcpu bindings. Signed-off-by: Steven Smith, sos22@cl.cam.ac.uk --- xen/common/event_channel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 29d10ef3d2..df97403972 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -220,10 +220,12 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind) chn1->u.interdomain.remote_dom = d2; chn1->u.interdomain.remote_port = (u16)port2; + chn1->notify_vcpu_id = 0; chn1->state = ECS_INTERDOMAIN; chn2->u.interdomain.remote_dom = d1; chn2->u.interdomain.remote_port = (u16)port1; + chn2->notify_vcpu_id = 0; chn2->state = ECS_INTERDOMAIN; out: @@ -324,8 +326,10 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind) chn = evtchn_from_port(d, port); + chn->notify_vcpu_id = 0; + d->pirq_to_evtchn[pirq] = port; - rc = pirq_guest_bind(d->vcpu[chn->notify_vcpu_id], pirq, + rc = pirq_guest_bind(d->vcpu[0], pirq, !!(bind->flags & BIND_PIRQ__WILL_SHARE)); if ( rc != 0 ) { -- 2.30.2